package com.ymatou.iapi.login.service;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*微信公众号登录（全球优选）
*FreeMaker Template自动生成代码
*/
public class WxWapLoginCall extends YmatouBaseCall{
	private static String opurl ="global/wxWapLogin";
	
	public WxWapLoginCall() {
		super(EnvSetup.getSystemUrl("login_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	public String getToken() {
		return getJsonObject().get("data").getAsJsonObject().get("token").getAsString();
	}
	public Integer getUserId() {
		return getJsonObject().get("data").getAsJsonObject().get("userId").getAsInt();
	}
	public String getLoginId() {
		return getJsonObject().get("data").getAsJsonObject().get("loginId").getAsString();
	}
}